package com.macro.mall.controller;


import com.macro.mall.common.api.CommonResult;
import com.macro.mall.model.PinionParam;
import com.macro.mall.service.SysDashboardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/***
 * 工作台前段控制器
 */
@RestController
@RequestMapping("sys/dashboard")
public class SysDashboardController {


    @Autowired
    private SysDashboardService dashboardService;


    /***
     * 获取最新的舆情数据
     * @return
     */
    @GetMapping("newestOpinionData")
    public CommonResult newestOpinionData() {
        return dashboardService.newestOpinionData();
    }

    /****
     * 舆情研判总览
     * @return
     */
    @GetMapping("getPubOpinionOverview")
    public CommonResult getPubOpinionOverview() {
        return dashboardService.getPubOpinionOverview();
    }


    /***
     * 舆情24小时统计
     * @return
     */
    @GetMapping("opinion24HrsSta")
    public CommonResult opinion24HrsSta() {
        return dashboardService.opinion24HrsSta();
    }


    /***
     * 获取区域统计
     * @return
     */
    @GetMapping("rgnlStatistics")
    public CommonResult rgnlStatistics() {
        return dashboardService.rgnlStatistics();
    }


    /***
     * 来源统计 饼图
     * @return
     */
    @GetMapping("srcStatistics")
    public CommonResult srcStatistics() {
        return dashboardService.srcStatistics();
    }

    /***
     * 来源统计 折线图
     * @return
     */
    @GetMapping("srcStatistics2")
    public CommonResult srcStatistics2() {
        return dashboardService.srcStatistics2();
    }


    /***
     * 负面舆情
     * @return
     */
    @GetMapping("negativeOpinion")
    public CommonResult negativeOpinion(PinionParam param) {
        return dashboardService.negativeOpinion(param);
    }

}
